const express = require('express');
const ArticleController = require('../router_controller/article');
const router = express.Router();


// 1. 导入 @escook/express-joi
const expressJoi = require('@escook/express-joi');
// 导入 校验规则对象
const { CreateArticle_schema, GetArticleList_schema, deleteArticle_schema, getArticleDetail_schema } = require('../schema/article');




router.post('/createArticle', expressJoi(CreateArticle_schema), ArticleController.createArticle);
router.post('/getArticleList', expressJoi(GetArticleList_schema), ArticleController.getArticleList);
router.post('/modifyArticle', ArticleController.modifyArticle);
router.post('/deleteArticle', expressJoi(deleteArticle_schema), ArticleController.deleteArticle);
router.post('/getArticleDetail', expressJoi(getArticleDetail_schema), ArticleController.getArticleDetail);
// router.post('/login', expressJoi(Login_schema), ArticleController.login)


module.exports = router;